﻿using System;
using System.Collections.Generic;
using System.Linq;
using jQueryApi;

namespace TuringMachine
{
   class InfoBox : MessageBoxBase
   {
      jQueryObject m_label = null;
      public event EventHandler CancelClicked;

      public InfoBox(jQueryObject parent) :
         base(parent)
      {
         string id = m_msgBox.GetAttribute("id");
         m_msgBox.Append("<span id=\"" + id + "msg\"></span><br />");
         m_label = m_msgBox.Children("#" + id + "msg");
         m_label.CSS("width", (m_msgBox.GetWidth()-50) + "px");
         m_label.CSS("height", "150px");
         m_label.CSS("top", "25px");
         m_label.CSS("display", "table-cell");
         m_label.CSS("vertical-align", "middle");
         m_okButton.pEnabled = false;
      }

      public string pLabelText
      {
         get { return m_label.GetText(); }
         set { m_label.Text(value); }
      }

      protected override void PlaceElements()
      {
         m_msgBox.CSS("height", "300px");
      }

      public override void OnShown()
      {
         
      }

      protected override void CancelButton_Click(TMButton sender)
      {
         if (CancelClicked != null)
            CancelClicked(this, null);
      }

      protected override void OkButton_Click(TMButton sender)
      {
      }
   }
}
